let BaseBean = require('@/common/BaseBean');
let comDriver = require('@/common/driver');

class Bean extends BaseBean {
    constructor(param = {}) {
        super(param);
    }

    async run(params) {
        await super.run(params);
        let value = comDriver.S2I(params.data.value);
        if ((params.data.control.text || '').length < value) {
            if (!params.data.silence) params.data.control.form.showError(params.data.control.param.label + '长度最小' + value + '个字符!');
            params.result = false;
        }

        return params;
    }

}

module.exports = Bean;
